<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    form label {
      opacity: 0;
    }
    form input:not(:placeholder-shown) + label {
      opacity: 1;
      transform: scale(1);
      bottom: 100%;
    }
  </style>
</head>
<body>
  <form action="">
    <input type="text" placeholder="姓名">
    <label for="">姓名</label>
  </form>
</body>
</html>